<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tld/authority.tld" prefix="authority" %>
<%@ taglib uri="/tld/token.tld" prefix="token" %>

<div class="pop-background">
    <div class="col-md-4">
        <div class="popup panel-alt x-4-move">
            <div class="panel-heading">
                <div class="panel-btns">
                    <a class="panel-close btn-4-hide">×</a>
                </div>
                <h3 class="panel-title">${empty manager.id ? '新增' : '修改'}</h3>
            </div>

            <div class="tab-content">
                <div class="panel-tab panel-default">
                    <div class="row ">
                        <form class="common-form">
                            <token:token/>
                            <input type="hidden" name="id" value="${manager.id}">
                            <input type="hidden" name="departmentId" value="${manager.departmentId}">
                            <div class="panel-body panel-body-h">
                                <h3 class="panel-titles" style="margin-top:-15px;">用户信息</h3>

                                <div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">
                                                <em class="color-red btian">*</em>用户姓名：</label>

                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="name"
                                                       value="${manager.name}">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">
                                                <em class="color-red btian">*</em>手机号码：
                                            </label>

                                            <div class="col-sm-6">
                                                <input type="text" class="form-control" name="mobile"
                                                       value="${manager.mobile}">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">所属部门：</label>

                                            <div class="col-sm-6">
                                                <div class="select-container select">
                                                    <select class="select select-offscreen deptLv1">
                                                        <option value="">-请选择-</option>
                                                        <c:forEach items="${departmentLv1List}" var="item">
                                                            <option value="${item.id}" ${item.id == departmentLv1Id ? 'selected' : ''}>${item.name}</option>
                                                        </c:forEach>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label"></label>
                                            <div class="col-sm-6">
                                                <div class="select-container select">
                                                    <select class="select select-offscreen deptLv2">
                                                        <option value="">-请选择-</option>
                                                        <c:forEach items="${departmentLv2List}" var="item">
                                                            <option value="${item.id}" ${item.id == departmentLv2Id ? 'selected' : ''}>${item.name}</option>
                                                        </c:forEach>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">性别：</label>

                                            <div class="col-sm-6">
                                                <div class="select-container select">
                                                    <select class="select select-offscreen" name="gender">
                                                        <option value="0" ${0 == manager.gender ? 'selected' : ''}>女
                                                        </option>
                                                        <option value="1" ${1 == manager.gender ? 'selected' : ''}>男
                                                        </option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <h3 class="panel-titles" style="margin-bottom:5px; margin-top:10px;">角色分配</h3>

                                <div class="panel-checkbox">
                                    <table>
                                        <tbody>
                                        <tr>
                                            <c:forEach items="${roleList}" var="item">
                                                <td ${1 ne item.id and 1 ne manager.id?'':'style=display:none;'}>
                                                    <label class="cursor-pointer">
                                                        <input type="checkbox" class="cursor-pointer" name="roleId"
                                                               value="${item.id}" ${item.checked ? 'checked' : ''}>${item.name}
                                                    </label>
                                                </td>
                                            </c:forEach>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </form>

                        <form class="fup" method="post" enctype="multipart/form-data">
                            <input class="cursor-pointer btn-4-fup" type="file" name="file"
                                   style="opacity:0;position:absolute;left:0;top:0;width:0;height:0;"/>
                        </form>
                    </div>
                    <div class="btn-group2-s">
                        <div class="panel-body panel-body2">
                            <div class="btn-group2 left ">
                                <%--<authority:authority url="/manager/add,/manager/modify">--%>
                                    <button type="button" class="btn btn-primary btn-4-save">保存</button>
                                <%--</authority:authority>--%>
                                <button type="button" class="btn btn-default btn-4-hide">取消</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <script src="js/system/manager-edit.js"></script>
</div>